<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <script src="js/装饰模式的接口.js"></script>
    <script>
        var properties = {
            name: "Remember to buy the milk",
            date: "05/06/2016",
            actions: {
                summary: function () {
                    return "Remember to buy the milk, we are almost out!";
                },
                placeOrder: function () {
                    return "Ordering milk from your local grocery store";
                }
            }
        };
        // Create a new instance of our Todo constructor
        var todoItem =new Todo(properties);
        console.log(todoItem);
        // Finally test to make sure these function correctly
        console.log(todoItem.methods.summary());
        console.log(todoItem.methods.placeOrder());
        // Outputs:
        // Remember to buy the milk, we are almost out!
        // Ordering milk from your local grocery store
    </script>
</body>
</html>